disable use of bulk upload for small files
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Thu, 10 Apr 2025 12:35:11 +0000 (14:35 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Thu, 10 Apr 2025 14:56:34 +0000 (14:56 +0000)
this feature causes many issues with impact on users so we prefer to
disable it again

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/owncloudpropagator.cpp
test/testsyncengine.cpp

index 969a8ba031afc30f2d63294381df3e34bc7a7c5b..30b48ef874a1cdb1122a5ece7a5c92404adf8035 100644 (file)
@@ -1091,29 +1091,9 @@ Result<Vfs::ConvertToPlaceholderResult, QString> OwncloudPropagator::staticUpdat
 
 bool OwncloudPropagator::isDelayedUploadItem(const SyncFileItemPtr &item) const
 {
-    const auto checkFileShouldBeEncrypted = [this] (const SyncFileItemPtr &item) -> bool {
-        const auto path = item->_file;
-        const auto slashPosition = path.lastIndexOf('/');
-        const auto parentPath = slashPosition >= 0 ? path.left(slashPosition) : QString();
-
-        SyncJournalFileRecord parentRec;
-        bool ok = _journal->getFileRecord(parentPath, &parentRec);
-        if (!ok) {
-            return false;
-        }
-
-        const auto accountPtr = account();
+    Q_UNUSED(item)
 
-        if (!parentRec.isValid() ||
-            !parentRec.isE2eEncrypted()) {
-            return false;
-        }
-
-        return true;
-    };
-
-    return account()->capabilities().bulkUpload() && !_scheduleDelayedTasks && !item->isEncrypted() && _syncOptions.minChunkSize() > item->_size
-        && !isInBulkUploadBlackList(item->_file) && !checkFileShouldBeEncrypted(item);
+    return false;
 }
 
 void OwncloudPropagator::setScheduleDelayedTasks(bool active)
index 21ca008f92582f17cd01c673e50e446500d893cc..3d71244213d55e6e6b53ea2caca2fa42482c286d 100644 (file)
@@ -150,6 +150,8 @@ private slots:
     }
 
     void testDirUploadWithDelayedAlgorithm() {
+        QSKIP("bulk upload is disabled");
+
         FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
         fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });
 
@@ -181,6 +183,8 @@ private slots:
     }
 
     void testDirUploadWithDelayedAlgorithmWithNewChecksum() {
+        QSKIP("bulk upload is disabled");
+
         FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
         fakeFolder.setServerVersion(QStringLiteral("32.0.0"));
         fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });
@@ -1009,6 +1013,8 @@ private slots:
      */
     void testErrorsWithBulkUpload()
     {
+        QSKIP("bulk upload is disabled");
+
         FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() };
         fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });
 
@@ -1104,6 +1110,8 @@ private slots:
      */
     void testNetworkErrorsWithBulkUpload()
     {
+        QSKIP("bulk upload is disabled");
+
         FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() };
         fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });
 
@@ -1152,6 +1160,8 @@ private slots:
 
     void testNetworkErrorsWithSmallerBatchSizes()
     {
+        QSKIP("bulk upload is disabled");
+
         FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() };
         fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });
 
@@ -1477,6 +1487,8 @@ private slots:
 
     void testLocalInvalidMtimeCorrectionBulkUpload()
     {
+        QSKIP("bulk upload is disabled");
+
         const auto INVALID_MTIME = QDateTime::fromSecsSinceEpoch(0);
         const auto RECENT_MTIME = QDateTime::fromSecsSinceEpoch(1743004783); // 2025-03-26T16:59:43+0100